import 'package:base_plugin/base_plugin.dart';
import 'package:finance_app/generated/l10n.dart';
import 'package:finance_app/src/common/app_colors.dart';
import 'package:finance_app/src/common/app_spaces.dart';
import 'package:finance_app/src/widgets/button/normal_button.dart';
import 'package:flutter/material.dart';

import 'default_bottom_sheet.dart';

/// rejected
showTransactionsGotItTipBottomSheet(BuildContext context,
        {VoidCallback onGotIt, String gotBtnText}) =>
    showDefaultBottomSheet(
      context,
      child: _GotItTipWidget(
        onGotIt: onGotIt,
        gotBtnText: gotBtnText,
      ),
      title: S.current.transactions,
      isScrollControlled: true,
    );

class _GotItTipWidget extends StatelessWidget {
  final VoidCallback onGotIt;
  final String gotBtnText;

  const _GotItTipWidget({Key key, this.onGotIt, this.gotBtnText})
      : super(key: key);

  @override
  Widget build(BuildContext context) {
    final titleStyle = TextStyle(
      color: aceBlackColor,
      fontSize: getSp(16),
      fontWeight: FontWeight.w400,
      height: 22 / 16,
    );
    return Padding(
      padding: EdgeInsets.only(
        top: getDp(20),
        left: getDp(36),
        right: getDp(36),
      ),
      child: Column(
        mainAxisSize: MainAxisSize.min,
        crossAxisAlignment: CrossAxisAlignment.start,
        children: [
          Text(
            S.current.what_counts_as_transaction,
            style: TextStyle(
              color: aceBlueColor,
              fontSize: getSp(18),
              fontWeight: FontWeight.w700,
              height: 1,
            ),
          ),
          AppSpaces.h10,
          ...<String>[
            '• ${S.current.expense}',
            '• ${S.current.bill}',
            '• ${S.current.purchase_order}',
            '• ${S.current.money_out}',
            '• ${S.current.quotation}',
            '• ${S.current.invoice}',
            '• ${S.current.money_in}',
          ].map((e) => Padding(
                padding: EdgeInsets.symmetric(vertical: getDp(4)),
                child: Text(
                  e,
                  style: titleStyle,
                  textAlign: TextAlign.center,
                ),
              )),
          SizedBox(
            height: getDp(30),
          ),
          NormalButton(
            onTap: onGotIt ??
                () {
                  Navigator.of(context).pop();
                },
            title: gotBtnText ?? S.current.got_it,
          ),
        ],
      ),
    );
  }
}
